﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using Noria.Net.Chaos;

[assembly: log4net.Config.XmlConfigurator]

namespace Noria.Net.Chaos
{
    class Program
    {
        static void Main(string[] args)
        {
            var svc = new ChaosService();

            if (Environment.UserName == "SYSTEM")
            {
                // run as service
                ServiceBase.Run(svc);
            }
            else
            {
                // run as user
                Console.WriteLine("Chaos is running uder user mode, hit enter to exit...");
                svc.Start();
                Console.ReadLine();
                svc.Stop();
                Console.WriteLine("Bye");
            }
        }
    }
}
